home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Communications / Network / Send File Script Folder / Send File Script (text) < prev   
Text File  |  1994-05-24  |  2KB  |  55 lines

  1. -- This script is very useful with Eudora 1.4 (I use 1.4.2)
  2. -- It allows one to select a file on a disk that will be automagically attached
  3. -- to an autoreply to messages whose "Subject:" field matches some user-specified
  4. -- string.
  5. -- I wrote this script to learn more about how to script Eudora, and I hope it will
  6. -- help other people too. Of course, feel free to modify the script to suit your needs,
  7. -- just don't distribute the modified scripts along with this package.
  8. -- Please distribute this package (compiled script, text source, readme) to anybody 
  9. -- who wants it, Just drop me a line (e-mail) if you like it!
  10.  
  11. -- Just my little contribution to the 'net community...
  12.  
  13. property fileToSend : ""
  14. property subjToMatch : ""
  15.  
  16. if fileToSend is "" then
  17.     set fileToSend to choose file with prompt ¬
  18.         "Select a file to attach please..."
  19. else
  20.     set dlg to display dialog "File to attach:" default answer (¬
  21.         fileToSend as string) ¬
  22.         buttons {"Select...", "Cancel", "OK"} ¬
  23.         default button "OK"
  24.     set fileToSend to text returned of dlg
  25.     if button returned of dlg is "Select..." then
  26.         set fileToSend to choose file with prompt ¬
  27.             "Select a file to attach please..."
  28.     end if
  29. end if
  30.  
  31. display dialog "Subject to match:" default answer subjToMatch
  32. set subjToMatch to text returned of result
  33.  
  34. tell application "Eudora1.4.2"
  35.     set i to count message in mailbox "In" of mail folder ""
  36.     set curMsg to 1
  37.     set trashMsg to count message in mailbox "Trash" of mail folder ""
  38.     repeat i times
  39.         if field "Subject:" of message curMsg of mailbox "In" of mail folder "" ¬
  40.             contains subjToMatch then
  41.             move (message curMsg of mailbox "In" of mail folder "") ¬
  42.                 inserthere end of mailbox "Trash" of mail folder ""
  43.             set trashMsg to trashMsg + 1
  44.             set theReply to reply (message trashMsg of mailbox "Trash" ¬
  45.                 of mail folder "")
  46.             attach theReply documentlist fileToSend
  47.             with timeout of 600 seconds
  48.                 queue theReply queuetype 1
  49.             end timeout
  50.         else
  51.             set curMsg to curMsg + 1
  52.         end if
  53.     end repeat
  54.     -- Don't forget to connect  to send the queued messages
  55. end tell